package com.thread.plbc;

import java.util.Scanner;

/**
 * @author げっしょく
 * @date 2021/8/5
 */
public class ThreadD4exer implements Runnable{
    int money = 10000;

    @Override
    public void run() {
        Scanner sc = new Scanner(System.in);
        System.out.println("t1输入你要取款的金额：");
        int d =sc.nextInt();
        if(d > money){
            System.out.println("余额不够！！");
            System.out.println("您卡里的余额为：" + money);
        }else{
            System.out.println("成功取出" + d  + "元");
            money -= d;
            System.out.println("您卡里的余额还有：" + money + "元");
        }
        ThreadDemo4 td = new ThreadDemo4();
        td.money = this.money;
    }
}
